/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package BUSINESS_LAYER;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author cmerino
 */
public class classLog {

    public String getLog() throws IOException {
        BufferedReader entrada = null;
        String strLog = "";
        try {
            classPropertie prop = new classPropertie();
            File f = new File(prop.getPropertie("PropPath:estanques.log"));
            entrada = new BufferedReader(new FileReader(f));
            String strAux;
            if (f.exists()) {
                do {
                    strAux = entrada.readLine();
                    if (strAux == null) {
                        break;
                    } else {
                        strLog += strAux;
                    }
                } while (true);

                entrada.close();
                System.out.println(strLog);
            }
            return (strLog);
        } catch (FileNotFoundException ex) {
            Logger.getLogger(classLog.class.getName()).log(Level.SEVERE, null, ex);
        } finally {
            try {
                entrada.close();
            } catch (IOException ex) {
                Logger.getLogger(classLog.class.getName()).log(Level.SEVERE, null, ex);
            } finally {
                return "";
            }
        }
    }
}
